<div class="context-menu">
	<ul>
		<li><?php echo $html->link('Add new page', '/admin/pages/add') ?></li>
	</ul>
</div>

<div class="paging">
<div>
	Sort by : 
	<?php echo $paginator->sort(__('date',true),'created');?> 
	<?php echo $paginator->sort(__('category',true),'category_id');?>
	
</div>

	<?php echo $paginator->prev('<< '.__('previous', true));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>');?>
</div>

<?php foreach($pages as $page): ?>

<h3>
	<?php if($page['Page']['online'] == 1) : ?>
		<?php echo $html->image('admin/bullet-green.gif', array('alt'=>'Page is online', 'style' => 'vertical-align : middle')); ?> 
	<?php else : ?>
		<?php echo $html->image('admin/bullet-red.gif', array('alt'=>'Page is offline', 'style' => 'vertical-align : middle')); ?> 
	<?php endif; ?>
	<?php echo $html->link($page['Page']['title'], "/pages/view/".$page['Page']['slug']); ?>
</h3>
<p class="content"><?php echo $html2->substr($page['Page']['content'], 200, 'x_stripAll'); ?></p>

<div class="info">
	<?php echo $page['Page']['created']; ?> -
	In <?php echo $page['Category']['title']; ?> Category -
	<?php echo $page['Page']['comments_count']; ?> Comments -
	<?php echo $html->link('Edit', '/admin/pages/edit/'.$page['Page']['id']); ?>
	<?php echo $html2->link('Delete','/admin/pages/delete/'.$page['Page']['id'], null, 'Are you sure to delete this page?') ?>
</div>

<?php endforeach; ?>

<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>');?>
</div>
